home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
551-575
/
disk_559
/
apig
/
apiglib_v11.lzh
/
e19_preferences.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-09-28
|
6KB
|
166 lines
/* example using Intuition GETPREFS, see Intuition RKM for offsets */
x = addlib('apig.library',0,-30,0)
call set_apig_globals()
prefs = allocmem(232) /* allocate memory to hold preferences data */
x = getprefs(prefs,232) /* x = getdefprefs(prefs,232) */
/* CONSULT RKM's FOR OFFSETS USED IN GETVALUE() CALLS */
call writeln(stdout,'0a'x "These are your Current Preferences Settings")
fontheight = GETVALUE(prefs,0,1,'n')
call writeln(stdout,'0a0a'x"Font Height = " fontheight '0a'x)
printerport = GETVALUE(prefs,1,1,'n')
call writech(stdout,"Printer Port = ")
if printerport = 0 then
call writeln(stdout,"PARALLEL" '0a'x)
else
if printerport = 1 then
call writeln(stdout,"SERIAL" '0a'x)
baudrate = GETVALUE(prefs,2,2,'n')
call writech(stdout,"Baud Rate = ")
select
when baudrate = 0 then call writeln(stdout,"BAUD_110" '0a'x)
when baudrate = 1 then call writeln(stdout,"BAUD_300" '0a'x)
when baudrate = 2 then call writeln(stdout,"BAUD_1200" '0a'x)
when baudrate = 3 then call writeln(stdout,"BAUD_2400" '0a'x)
when baudrate = 4 then call writeln(stdout,"BAUD_4800" '0a'x)
when baudrate = 5 then call writeln(stdout,"BAUD_9600" '0a'x)
when baudrate = 6 then call writeln(stdout,"BAUD_19200" '0a'x)
when baudrate = 7 then call writeln(stdout,"BAUD_MIDI" '0a'x)
otherwise nop
end
keyrptspeed1 = GETVALUE(prefs,4,4,'n')
keyrptspeed2 = GETVALUE(prefs,8,4,'n')
keyrptdelay1 = GETVALUE(prefs,12,4,'n')
keyrptdelay2 = GETVALUE(prefs,16,4,'n')
doubleclick1 = GETVALUE(prefs,20,4,'n')
doubleclick2 = GETVALUE(prefs,24,4,'n')
enablecli = GETVALUE(prefs,124,2,'n')
call writech(stdout,"Enable CLI = ")
if enablecli = 0 then call writeln(stdout,"OFF" '0a'x)
else call writeln(stdout,"ON" '0a'x)
printertype = GETVALUE(prefs,126,2,'n')
call writech(stdout,"Printer Type = ")
select
when printertype = 0 then call writeln(stdout,"CUSTOM_NAME" '0a'x)
when printertype = 1 then call writeln(stdout,"ALPHA_P_101" '0a'x)
when printertype = 2 then call writeln(stdout,"BROTHER_15XL" '0a'x)
when printertype = 3 then call writeln(stdout,"CBM_MPS1000" '0a'x)
when printertype = 4 then call writeln(stdout,"DIAB_630" '0a'x)
when printertype = 5 then call writeln(stdout,"DIAB_ADV_D25" '0a'x)
when printertype = 6 then call writeln(stdout,"DIAB_C_150" '0a'x)
when printertype = 7 then call writeln(stdout,"EPSON" '0a'x)
when printertype = 8 then call writeln(stdout,"EPSON_JX_80" '0a'x)
when printertype = 9 then call writeln(stdout,"OKIMATE_20" '0a'x)
when printertype = 10 then call writeln(stdout,"QUME_LP_20" '0a'x)
when printertype = 11 then call writeln(stdout,"HP_LASERJET" '0a'x)
when printertype = 12 then call writeln(stdout,"HP_LASERJET_PLUS" '0a'x)
otherwise nop
end
/* note below how the printer name is gotten *
* prtname = GETVALUE(prefs,128,4,'s') WILL NOT WORK, since the contents *
at offset 128 is not a pointer */
/* instead create a pointer to prtname, and use IMPORT() to create & copy *
it into an ARexx string variable */
prtnamebuf = d2c((c2d(prefs) + 128),4) /* create pointer to name buf */
prtname = import(prtnamebuf) /* import data from buf into strg */
call writeln(stdout,"Printer Name = " prtname '0a'x)
prtpitch = GETVALUE(prefs,158,2,'n')
call writech(stdout,"Print Pitch = ")
select
when prtpitch = 0 then call writeln(stdout,"PICA" '0a'x)
when prtpitch = c2d('0400'x) then call writeln(stdout,"ELITE" '0a'x)
when prtpitch = c2d('0800'x) then call writeln(stdout,"FINE" '0a'x)
otherwise nop
end
prtquality = GETVALUE(prefs,160,2,'n')
call writech(stdout,"Print Quality = ")
select
when prtquality = 0 then call writeln(stdout,"DRAFT" '0a'x )
when prtquality = c2d('0100'x) then call writeln(stdout,"LETTER" '0a'x)
otherwise nop
end
prtspacing = GETVALUE(prefs,162,2,'n')
call writech(stdout,"Print Spacing = ")
if prtspacing = 0 then call writeln(stdout,"SIX_LPI" '0a'x)
else
if prtspacing = c2d('0200'x) then call writeln(stdout,"EIGHT_LPI" '0a'x)
prtleftmar = GETVALUE(prefs,164,2,'n')
call writeln(stdout,"Left Print Margin = " prtleftmar '0a'x)
prtrightmar = GETVALUE(prefs,166,2,'n')
call writeln(stdout,"Right Print Margin = " prtrightmar '0a'x)
papersize = GETVALUE(prefs,176,2,'n')
call writech(stdout,"Paper Size = ")
select
when papersize = 0 then call writeln(stdout,"US_LETTER" '0a'x)
when papersize = 16 then call writeln(stdout,"US_LEGAL" '0a'x)
when papersize = 32 then call writeln(stdout,"NARROW TRACTOR" '0a'x)
when papersize = 48 then call writeln(stdout,"WIDE TRACTOR" '0a'x)
when papersize = 64 then call writeln(stdout,"CUSTOM" '0a'x)
otherwise nop
end
paperlen = GETVALUE(prefs,178,2,'n')
call writeln(stdout,"Paper Length = " paperlen '0a'x)
papertype = GETVALUE(prefs,180,2,'n')
call writech(stdout,"Paper Type = ")
if papertype = 0 then call writeln(stdout,"FANFOLD" '0a'x)
else
if papertype = 128 then call writeln(stdout,"LETTER" '0a'x)
lacewb = GETVALUE(prefs,185,1,'n')
call writech(stdout,"LACE WB = " )
if lacewb = 1 then call writeln(stdout,"ON" '0a'x)
else call writeln(stdout,"OFF" '0a'x)
call freemem(prefs,232)
/* ------------------------------------------------------------------- */
screendata = allocmem(346)
x = getscreendata(screendata,346,WBENCHSCREEN,0)
say "WorkBench Screen Width = " GETVALUE(screendata,12,2,'n')
say "WorkBench Screen Height = " GETVALUE(screendata,14,2,'n')
say "WorkBench Screen Title = " GETVALUE(screendata,22,4,'s')
call freemem(screendata,346)
exit